package com.hxx.day2.controller;

import org.junit.Test;

public class TestDemo {

    public void show()throws MyException{
        System.out.println("show");
    }

    @Test
    public void test1() {
        try {
            show();
        } catch (MyException e) {
            try {
                throw new MyException("自定义异常");
            } catch (MyException ex) {
                throw new RuntimeException(ex);
            }
        }
    }

    //------------------------------------------
    public void show1()throws MyRuntimeException{}

    @Test
    public void test2() {
        try {
            show1();
        } catch (MyRuntimeException e) {
            throw new MyRuntimeException("自定义异常");
        }
    }
}





















